package com.qfedu.lc.app.service;

import com.qfedu.lc.app.config.OpenFeignConfig;
import com.qfedu.lc.common.config.SystemConfig;
import com.qfedu.lc.common.param.UserAdd;
import com.qfedu.lc.common.param.UserLogin;
import com.qfedu.lc.common.vo.R;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.servlet.http.HttpServletRequest;

/**
 * configuration = OpenFeignConfig.class
 * 配置将header中的token 传递到请求RequsetTemplate 中，后续user-server可以从header中得到token
 */
@FeignClient(value = "lc-userserver",configuration = OpenFeignConfig.class)
public interface UserFeign {


    @RequestMapping("/user/register")
    public R register(@RequestBody UserAdd userAdd);


    /**
     * 账户密码登录接口
     * @param userLogin
     * @return
     */
    @RequestMapping("/user/loginpass")
    public R loginPass(@RequestBody UserLogin userLogin);


    /**
     * 退出登录
     * @return
     */
    @RequestMapping(value = "/user/logout",method = RequestMethod.GET)
    public R logout();

}
